home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / apps / cmapDoctor / cmapdoctor / DrcmapControl.c++ < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  10.7 KB  |  348 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /////////////////////////////////////////////////////////////
  18. //
  19. // Source file for DrcmapControl
  20. //
  21. //    This file generated by a BuilderXcessory.  DO NOT EDIT THIS FILE.
  22. //    TO ADD EXTENSIONS TO THIS CLASS, USE THE BUILDER XCESSORY
  23. //    TO CREATE A SUBCLASS.
  24. //
  25. //    This class is a user interface "component", as described
  26. //    in "Object-Oriented Programming with C++ and OSF/Motif",
  27. //    by Douglas Young, Prentice Hall, 1992. ISBN 0-13-630252-1
  28. //
  29. //
  30. /////////////////////////////////////////////////////////////
  31.  
  32.  
  33. #include "DrcmapControl.h" // Generated header file for this class
  34. #include <Xm/BulletinB.h> 
  35. #include <Xm/Frame.h> 
  36. #include <Xm/Label.h> 
  37. #include <Xm/List.h> 
  38. #include <Xm/PushB.h> 
  39. #include <Xm/ScrolledW.h> 
  40. #ifndef XmNrow    
  41. #define XmNrow "row"
  42. #endif    
  43. #ifndef XmNcolumn    
  44. #define XmNcolumn "column"
  45. #endif     
  46. // Externally defined classes referenced by this class ;
  47.  
  48. #include "DrawwinDerived.h"
  49. #include "DrcmapControlDerived.h"
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. // These are default resources for widgets in objects of this class
  58. // All resources will be prepended by *<name> at instantiation,
  59. // where <name> is the name of the specific instance, as well as the
  60. // name of the baseWidget. These are only defaults, and may be overriden
  61. // in a resource file by providing a more specific resource name
  62.  
  63. String  DrcmapControl::_defaultDrcmapControlResources[] = {
  64.         NULL
  65. };
  66.  
  67. DrcmapControl::DrcmapControl(const char *name, Widget parent) : 
  68.          VkComponent(name) 
  69.     Arg      args[4];
  70.     Cardinal count;
  71.     Boolean  argok;
  72.  
  73.     count = 0;
  74.  
  75.     // Load any class-defaulted resources for this object
  76.  
  77.     setDefaultResources(parent, _defaultDrcmapControlResources  );
  78.  
  79.  
  80.  
  81.     // Create an unmanaged widget as the top of the widget hierarchy
  82.  
  83.     _baseWidget = _drcmapControl= XtVaCreateWidget ( _name,
  84.                                         xmBulletinBoardWidgetClass,
  85.                                         parent, 
  86.                                             XmNresizePolicy, XmRESIZE_NONE, 
  87.                                         NULL); 
  88.  
  89.     // install a callback to guard against unexpected widget destruction
  90.  
  91.     installDestroyHandler();
  92.  
  93.  
  94.     // Create widgets used in this component
  95.     // All variables are data members of this class
  96.  
  97.     _listHeader = XtVaCreateManagedWidget  ( "listHeader",
  98.                                             xmLabelWidgetClass,
  99.                                             _w, 
  100.                                             XmNalignment, XmALIGNMENT_BEGINNING, 
  101.                                             XmNheight, 17, 
  102.                                             NULL); 
  103.  
  104.  
  105.     _rgbDisp = XtVaCreateManagedWidget  ( "rgbDisp",
  106.                                             xmLabelWidgetClass,
  107.                                             _w, 
  108.                                             NULL); 
  109.  
  110.  
  111.     _pickList1 = XtVaCreateManagedWidget  ( "pickList1",
  112.                                             xmPushButtonWidgetClass,
  113.                                             _w, 
  114.                                             XmNborderWidth, 0, 
  115.                                             XmNheight, 30, 
  116.                                             NULL); 
  117.  
  118.     XtAddCallback ( _pickList1,
  119.                     XmNarmCallback,
  120.                     &DrcmapControl::pickListCallback,
  121.                     (XtPointer) this ); 
  122.  
  123.  
  124.     _rootList1 = XtVaCreateManagedWidget  ( "rootList1",
  125.                                             xmPushButtonWidgetClass,
  126.                                             _w, 
  127.                                             XmNborderWidth, 0, 
  128.                                             XmNheight, 30, 
  129.                                             NULL); 
  130.  
  131.     XtAddCallback ( _rootList1,
  132.                     XmNarmCallback,
  133.                     &DrcmapControl::rootListCallback,
  134.                     (XtPointer) this ); 
  135.  
  136.  
  137.     _nextCmap1 = XtVaCreateManagedWidget  ( "nextCmap1",
  138.                                             xmPushButtonWidgetClass,
  139.                                             _w, 
  140.                                             XmNrecomputeSize, False, 
  141.                                             NULL); 
  142.  
  143.     XtAddCallback ( _nextCmap1,
  144.                     XmNactivateCallback,
  145.                     &DrcmapControl::nextCmapCallback,
  146.                     (XtPointer) this ); 
  147.  
  148.     XtAddCallback ( _nextCmap1,
  149.                     XmNarmCallback,
  150.                     &DrcmapControl::pushedBtnrCallback,
  151.                     (XtPointer) this ); 
  152.  
  153.     XtAddCallback ( _nextCmap1,
  154.                     XmNdisarmCallback,
  155.                     &DrcmapControl::normalBtnrCallback,
  156.                     (XtPointer) this ); 
  157.  
  158.  
  159.     _prevCmap1 = XtVaCreateManagedWidget  ( "prevCmap1",
  160.                                             xmPushButtonWidgetClass,
  161.                                             _w, 
  162.                                             NULL); 
  163.  
  164.     XtAddCallback ( _prevCmap1,
  165.                     XmNactivateCallback,
  166.                     &DrcmapControl::prevCmapCallback,
  167.                     (XtPointer) this ); 
  168.  
  169.     XtAddCallback ( _prevCmap1,
  170.                     XmNarmCallback,
  171.                     &DrcmapControl::pushedBtnlCallback,
  172.                     (XtPointer) this ); 
  173.  
  174.     XtAddCallback ( _prevCmap1,
  175.                     XmNdisarmCallback,
  176.                     &DrcmapControl::normalBtnlCallback,
  177.                     (XtPointer) this ); 
  178.  
  179.  
  180.     _scrolledWindow = XtVaCreateManagedWidget  ( "scrolledWindow",
  181.                                             xmScrolledWindowWidgetClass,
  182.                                             _w, 
  183.                                             XmNscrollingPolicy, XmAPPLICATION_DEFINED, 
  184.                                             XmNscrollBarDisplayPolicy, XmSTATIC, 
  185.                                             NULL); 
  186.  
  187.  
  188.     _list1 = XtVaCreateManagedWidget  ( "list1",
  189.                                             xmListWidgetClass,
  190.                                             _scrolledWindow, 
  191.                                             XmNlistSizePolicy, XmCONSTANT, 
  192.                                             XmNscrollBarDisplayPolicy, XmSTATIC, 
  193.                                             NULL); 
  194.  
  195.     XtAddCallback ( _list1,
  196.                     XmNbrowseSelectionCallback,
  197.                     &DrcmapControl::pickCmapCallback,
  198.                     (XtPointer) this ); 
  199.  
  200.  
  201.     _frame = XtVaCreateManagedWidget  ( "frame",
  202.                                             xmFrameWidgetClass,
  203.                                             _w, 
  204.                                             XmNx, 24, 
  205.                                             XmNy, 24, 
  206.                                             XmNwidth, 258, 
  207.                                             XmNheight, 258, 
  208.                                             NULL); 
  209.  
  210.  
  211.     _drawwin = new DrawwinDerived( "drawwin",_frame);
  212.     _drawwin->manage();
  213.  
  214. }
  215.  
  216. DrcmapControl::~DrcmapControl() 
  217. {
  218.     // Empty Destructor. Base class destroys widgets
  219. }
  220.  
  221. const char * DrcmapControl::className() // classname
  222. {
  223.     return ("DrcmapControl");
  224. }
  225.  
  226. void DrcmapControl::nextCmapCallback (Widget w, XtPointer clientData, XtPointer callData) 
  227.     DrcmapControl* obj = (DrcmapControl *) clientData;
  228.  
  229.     obj->nextCmap(w, callData);
  230. }
  231.  
  232. void DrcmapControl::normalBtnlCallback (Widget w, XtPointer clientData, XtPointer callData) 
  233.     DrcmapControl* obj = (DrcmapControl *) clientData;
  234.  
  235.     obj->normalBtnl(w, callData);
  236. }
  237.  
  238. void DrcmapControl::normalBtnrCallback (Widget w, XtPointer clientData, XtPointer callData) 
  239.     DrcmapControl* obj = (DrcmapControl *) clientData;
  240.  
  241.     obj->normalBtnr(w, callData);
  242. }
  243.  
  244. void DrcmapControl::pickCmapCallback (Widget w, XtPointer clientData, XtPointer callData) 
  245.     DrcmapControl* obj = (DrcmapControl *) clientData;
  246.  
  247.     obj->pickCmap(w, callData);
  248. }
  249.  
  250. void DrcmapControl::pickListCallback (Widget w, XtPointer clientData, XtPointer callData) 
  251.     DrcmapControl* obj = (DrcmapControl *) clientData;
  252.  
  253.     obj->pickList(w, callData);
  254. }
  255.  
  256. void DrcmapControl::prevCmapCallback (Widget w, XtPointer clientData, XtPointer callData) 
  257.     DrcmapControl* obj = (DrcmapControl *) clientData;
  258.  
  259.     obj->prevCmap(w, callData);
  260. }
  261.  
  262. void DrcmapControl::pushedBtnlCallback (Widget w, XtPointer clientData, XtPointer callData) 
  263.     DrcmapControl* obj = (DrcmapControl *) clientData;
  264.  
  265.     obj->pushedBtnl(w, callData);
  266. }
  267.  
  268. void DrcmapControl::pushedBtnrCallback (Widget w, XtPointer clientData, XtPointer callData) 
  269.     DrcmapControl* obj = (DrcmapControl *) clientData;
  270.  
  271.     obj->pushedBtnr(w, callData);
  272. }
  273.  
  274. void DrcmapControl::rootListCallback (Widget w, XtPointer clientData, XtPointer callData) 
  275.     DrcmapControl* obj = (DrcmapControl *) clientData;
  276.  
  277.     obj->rootList(w, callData);
  278. }
  279.  
  280.  
  281.  
  282. void DrcmapControl::nextCmap(Widget, XtPointer) 
  283. {
  284.     // Empty virtual function. Called from nextCmapCallback.
  285.     // Derived classes can override.
  286. }
  287.  
  288. void DrcmapControl::normalBtnl(Widget, XtPointer) 
  289. {
  290.     // Empty virtual function. Called from normalBtnlCallback.
  291.     // Derived classes can override.
  292. }
  293.  
  294. void DrcmapControl::normalBtnr(Widget, XtPointer) 
  295. {
  296.     // Empty virtual function. Called from normalBtnrCallback.
  297.     // Derived classes can override.
  298. }
  299.  
  300. void DrcmapControl::pickCmap(Widget, XtPointer) 
  301. {
  302.     // Empty virtual function. Called from pickCmapCallback.
  303.     // Derived classes can override.
  304. }
  305.  
  306. void DrcmapControl::pickList(Widget, XtPointer) 
  307. {
  308.     // Empty virtual function. Called from pickListCallback.
  309.     // Derived classes can override.
  310. }
  311.  
  312. void DrcmapControl::prevCmap(Widget, XtPointer) 
  313. {
  314.     // Empty virtual function. Called from prevCmapCallback.
  315.     // Derived classes can override.
  316. }
  317.  
  318. void DrcmapControl::pushedBtnl(Widget, XtPointer) 
  319. {
  320.     // Empty virtual function. Called from pushedBtnlCallback.
  321.     // Derived classes can override.
  322. }
  323.  
  324. void DrcmapControl::pushedBtnr(Widget, XtPointer) 
  325. {
  326.     // Empty virtual function. Called from pushedBtnrCallback.
  327.     // Derived classes can override.
  328. }
  329.  
  330. void DrcmapControl::rootList(Widget, XtPointer) 
  331. {
  332.     // Empty virtual function. Called from rootListCallback.
  333.     // Derived classes can override.
  334. }
  335.  
  336.  
  337.  
  338.